<!--
 * @FilePath     : /study_code/jquery/plugin-jquery-tmpl-div.html
 * @Description  : 模板定义方式2：div 标签定义模板
 * @Date         : 2025-04-21 13:48:57
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-21 13:50:13
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>
  <body>
    <div id="container"></div>

    <!-- 3、定义模板（div 标签定义） -->
    <!-- 这也是定义模板的一种方式（但不推荐使用） -->
    <div id="inline" style="display: none">
      <label>${id}</label>
      <label>${name}</label>
      <br />
    </div>

    <script src="/jquery/dist/jquery.min.js"></script>
    <!-- <script src="/jquery.tmpl/index.js"></script> -->
    <script src="/jquery/plugins/jquery.tmpl/lib/jquery.tmpl.min.js"></script>
    <script>
      $(function () {
        var users = [
          { id: 'think8848', name: 'Joseph Chan' },
          { id: 'aCloud', name: 'Mary Cheung' },
        ]
        $('#inline').tmpl(users).appendTo('#container')
      })
    </script>
  </body>
</html>
